<?php

declare(strict_types=1);

namespace App\Job;

use App\Service\User\OrderService;
use Hyperf\AsyncQueue\Job;
use Hyperf\Utils\ApplicationContext;

/**
 * 订单确认任务
 * @author 陈奕文
 * @package App\Job
 */
class OrderConfirmJob extends Job
{

    /**
     * 订单编号
     * @var string
     */
    public $order_no;

    public function __construct(string $order_no)
    {
        $this->order_no = $order_no;
    }

    public function handle()
    {
        $container = ApplicationContext::getContainer();
        $orderService = $container->get(OrderService::class);
        $orderService->confirm($this->order_no);
    }
}
